package behavioral.command.base.cmds;

import behavioral.command.base.Command;
import behavioral.command.base.objs.Light;

/**
 * 对应Light的简单命令实现
 */
public class LightOnCmd implements Command {
    Light light;

    public LightOnCmd(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.on();
    }

    @Override
    public void undo() {
        light.off();
    }
}
